package 算法基础模板.chapter_02;

/**
 * @author Summerday
 */
public class MoniQueue {

    int[] q;

    int hh; // 队头
    int tt; // 队尾

    int n;

    MoniQueue(int n){
        q = new int[n];
        this.n = n;
        hh = 0;
        tt = -1;
    }

    void add_to_tail(int x){
        q[tt ++] = x;
    }

    int pop_from_head(){
        return q[hh ++];
    }

    int get_head(){
        return q[hh];
    }

    boolean isEmpty(){
        return hh <= tt;
    }
}
